package cn.itsource.crm.service.impl;



import cn.itsource.basic.service.impl.BaseServiceImpl;
import cn.itsource.crm.domain.Customer;
import cn.itsource.crm.domain.OrderForm;
import cn.itsource.crm.mapper.CustomerMapper;
import cn.itsource.crm.mapper.OrderFormMapper;
import cn.itsource.crm.service.ICustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CustomerServiceImpl extends BaseServiceImpl<Customer> implements ICustomerService {

    @Autowired
    private CustomerMapper customerMapper;

    @Autowired
    private OrderFormMapper orderformMapper;

    @Override
    public void saveCustomerAndorderform(Customer customer) {
        //先保存客户
        customerMapper.save(customer);
        //再保存维修主单
        OrderForm orderform = customer.getOrderform();
        orderformMapper.save(orderform);
    }

}
